<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div class = "box">
        <script>
            // 获取元素
            const box = document.querySelector('.box');
box.style.width = '200px';
box.style.height = '200px';
box.style.backgroundColor = 'blue';
box.style.border = '1px solid black';
box.style.borderTop = 'pink';
        </script>
    </div>
</body>
</html>